﻿using Demo.Domains.Entities.Sys;
using PmSoft.FormSchema.Attributes;
using System.ComponentModel.DataAnnotations;

namespace Demo.PetaPoco.Application.Dtos.User;

/// <summary>
/// 用户编辑模型
/// </summary>
[FormName("userEditModel")]
public class UserEditModel
{
	/// <summary>
	/// 用户ID
	/// </summary>
	[Display(Name = "用户ID")]
	[Required(ErrorMessage = "{0}为必填项")]
	[IgnoreInForm]
	public int? UserId { get; set; }

	/// <summary>
	/// 姓名或昵称 
	///</summary>
	[Display(Name = "姓名")]
	[Required(ErrorMessage = "{0}为必填项")]
	[StringLength(100, MinimumLength = 1, ErrorMessage = "{0}只允许输入{1}至{2}个字符")]
	public string Name { get; set; }
	/// <summary>
	/// 用户类型 
	///</summary>
	[Display(Name = "用户类型")]
	[Required(ErrorMessage = "{0}为必选项")]
	[FormComponent("RadioGroup")]
	public UserType? Type { get; set; }
	/// <summary>
	/// 单位ID 
	///</summary>
	[Display(Name = "单位")]
	[Required(ErrorMessage = "{0}为必选项")]
	[FormApiSelect("system/dept/select")]
	public int? DeptId { get; set; }
	/// <summary>
	/// 密码 
	///</summary>
	[Display(Name = "新密码")]
	[FormComponent("VbenInputPassword")]
	[StringLength(25, MinimumLength = 6)]
	public string? Password { get; set; }
}
